package com.yunfeisoft.business.service.impl;

import com.applet.base.BaseServiceImpl;
import com.yunfeisoft.business.dao.inter.SmsFlashPromotionProductRelationDao;
import com.yunfeisoft.business.model.SmsFlashPromotionProductRelation;
import com.yunfeisoft.business.service.inter.SmsFlashPromotionProductRelationService;
import com.applet.sql.separation.DataSourceChange;
import com.applet.utils.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * ClassName: SmsFlashPromotionProductRelationServiceImpl
 * Description: 商品限时购与商品关系表service实现
 * Author: Jackie liu
 * Date: 2020-06-02
 */
@Service("smsFlashPromotionProductRelationService")
public class SmsFlashPromotionProductRelationServiceImpl extends BaseServiceImpl<SmsFlashPromotionProductRelation, String, SmsFlashPromotionProductRelationDao> implements SmsFlashPromotionProductRelationService {

    @Override
    @DataSourceChange(slave = true)
    public Page<SmsFlashPromotionProductRelation> queryPage(Map<String, Object> params) {
        return getDao().queryPage(params);
    }

    @Override
    public boolean isDupProduct(String id, String flashPromotionId, String flashPromotionSessionId, String productId) {
        return getDao().isDupProduct(id, flashPromotionId, flashPromotionSessionId, productId);
    }

    /**
     * 查询首页秒杀商品列表
     * @param limit
     * @return
     */
    @Override
    public List<SmsFlashPromotionProductRelation> queryFlashPromotionProductIndex(int limit) {
        return getDao().queryFlashPromotionProductIndex(limit);
    }
}